import request from '@/utils/request'

export const login = (data: any) =>
  request({
    url: '/users/getUserToken',
    method: 'post',
    data
  })

export const getUserByToken = () =>
  request({
    url: "/users/userInfo/:userNum",
    method: 'get'
  })

export const getUsers = (data:any) =>
  request({
    url: "/users/users",
    method: 'post',
    data
  })

  export const addUser = (data:any) =>
  request({
    url: "/users/adduser",
    method: 'post',
    data
  })

  export const deleteUser = (userNum:Number) =>
  request({
    url: `/users/deleteuser/${userNum}`,
    method: 'delete'
  })

  export const updateUser = (data:any) =>
  request({
    url: "/users/updateuser",
    method: 'put',
    data
  })

export const getUserAllRoles = () =>
  request({
    url: "/users/roles",
    method: 'get'
  })

  